package com.yc.oop4;

//封装对象
public class Hero {
	private int blood;
	private int att;
	private int def;
	private int gold;
	private int exp;
	private int yKey;
	private int bKey;
	private int rKey;
	
	//为私有化的属性,提供公开的get/set方法
	public int getBlood() {
		return blood;
	}
	public void setBlood(int blood) {
		this.blood = blood;
	}
	public int getAtt() {
		return att;
	}
	public void setAtt(int att) {
		this.att = att;
	}
	public int getDef() {
		return def;
	}
	public void setDef(int def) {
		this.def = def;
	}
	public int getGold() {
		return gold;
	}
	public void setGold(int gold) {
		this.gold = gold;
	}
	public int getExp() {
		return exp;
	}
	public void setExp(int exp) {
		this.exp = exp;
	}
	public int getyKey() {
		return yKey;
	}
	public void setyKey(int yKey) {
		this.yKey = yKey;
	}
	public int getbKey() {
		return bKey;
	}
	public void setbKey(int bKey) {
		this.bKey = bKey;
	}
	public int getrKey() {
		return rKey;
	}
	public void setrKey(int rKey) {
		this.rKey = rKey;
	}
	
	//具体情况,具体分析
	public Hero() {
		this.blood = 1000;
		this.att = 10;
		this.def = 10;
		this.gold = 0;
		this.exp = 0;
		this.yKey = 1;
		this.bKey = 1;
		this.rKey = 1;
	}
	
	//这个方法,是我们用于输出对象的时候,输出的内容
	@Override
	public String toString() {
		return "勇士,血量:" + blood + ", 攻击:" + att + ", 防御:" + def + ", 金币:" + gold + ", 经验:" + exp + ", 黄钥匙:"
				+ yKey + ", 蓝钥匙:" + bKey + ", 红钥匙:" + rKey;
	}
	
	
	
}
